home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_sharkcaveamb.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  155 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_RoomAmb.cog
  4. #
  5. # Produces random ambient cave sounds when crossing adjoins
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC]  modified 12/3 by [CMG]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.  
  16.     #................MESSAGES........................
  17.     message     startup
  18.     message     crossed
  19.     message     pulse
  20.     
  21.     #................ACTORS..........................
  22.     
  23.     thing        player                                local
  24.     
  25.     
  26.     #................TRIGGERS........................
  27.     surface       oncross               linkID=2
  28.     surface       oncross1              linkID=2
  29.     surface       oncross2              linkID=2
  30.     surface       oncross3              linkID=2
  31.     surface       oncross4              linkID=2
  32.     surface       oncross5              linkID=2
  33.  
  34.     
  35.     
  36.     surface       offcross              linkID=3
  37.     surface       offcross1             linkID=3
  38.     surface       offcross2             linkID=3
  39.     surface       offcross3             linkID=3
  40.     surface       offcross4             linkID=3
  41.     surface       offcross5             linkID=3
  42.  
  43.     
  44.             
  45.     #................SOUNDS........................
  46.     sound       sndCave0=olv_outside_a05.wav        local
  47.     sound       sndCave1=lag_inside_a06.wav            local
  48.     sound       sndCave2=gen_amb_eerie_02.wav        local
  49.     sound       sndCave3=gen_cave_a2.wav              local
  50.     sound       sndCave4=nub_ambient1_a.wav            local
  51.     sound       sndCave5=gen_cave_a5.wav            local
  52.     sound       sndCave6=lag_inside_a01.wav            local
  53.     sound       sndCave7=lag_inside_a04.wav            local
  54.     sound        sndCave8=olv_outside_a03.wav        local
  55.         
  56.     #................VARIABLES........................
  57.     
  58.     float       caveFreq                            local
  59.     
  60.     flex        pulseTime                            local
  61.     flex        vol=1.0                                local
  62.     
  63. end
  64.  
  65. # ========================================================================================
  66.  
  67. code
  68.  
  69. startup:
  70.  
  71.     player = GetLocalPlayerThing();
  72.  
  73. return;
  74.  
  75.  
  76. # ========================================================================================
  77. crossed:
  78.  
  79.     If ((GetSenderID() == 2) && (GetSourceref() == player))
  80.             {
  81.             pulseTime=RandBetween(4, 12);
  82.             SetPulse(pulseTime);
  83.             }
  84.     
  85.     If ((GetSenderID() == 3) && (GetSourceref() == player))
  86.             {
  87.             SetPulse(0);
  88.             }
  89.  
  90. return;
  91. # ========================================================================================
  92. pulse:
  93.  
  94.         pulseTime=RandBetween(4, 8);
  95.         SetPulse(pulseTime);
  96.  
  97.     
  98.         # check if indy is swimming, if so set the pluse then drop out
  99.         if (GetMoveStatus(player) == 12) return;
  100.     
  101.  
  102.     caveFreq = Rand();
  103.  
  104.     if (caveFreq < 0.16)
  105.         {
  106.             PlaySoundLocal(sndCave0, vol, 1, 0, 0);
  107.         }
  108.         
  109.     if ((caveFreq > 0.16) && (caveFreq < 0.24))
  110.         {
  111.             PlaySoundLocal(sndCave1, vol, 1, 0, 0);
  112.         }
  113.         
  114.     if ((caveFreq > 0.24) && (caveFreq < 0.36))
  115.         {
  116.             PlaySoundLocal(sndCave2, vol, -1, 0, 0);
  117.         }
  118.     
  119.     if ((caveFreq > 0.36) && (caveFreq < 0.48))
  120.         {
  121.             PlaySoundLocal(sndCave3, vol, 1, 0, 0);
  122.         }
  123.     
  124.     if ((caveFreq > 0.48) && (caveFreq < 0.56))
  125.         {
  126.             PlaySoundLocal(sndCave4, vol, 0, 0, 0);
  127.         }
  128.     
  129.     if ((caveFreq > 0.56) && (caveFreq < 0.64))
  130.         {
  131.             PlaySoundLocal(sndCave5, vol, -1, 0, 0);
  132.         }
  133.  
  134.     if ((caveFreq > 0.64) && (caveFreq < 0.72))
  135.         {
  136.             PlaySoundLocal(sndCave6, vol, -1, 0, 0);
  137.         }
  138.  
  139.     if ((caveFreq > 0.72) && (caveFreq < 0.84))
  140.         {
  141.             PlaySoundLocal(sndCave7, vol, -1, 0, 0);
  142.         }
  143.  
  144.     if ((caveFreq > 0.84) && (caveFreq < 1.0))
  145.         {
  146.             PlaySoundLocal(sndCave8, vol, -1, 0, 0);
  147.         }
  148.         
  149.         return;
  150.     
  151. return;
  152. # ========================================================================================
  153.         
  154. end
  155.